from django.urls import re_path
from channels.routing import URLRouter
from django.conf.urls import url
from . import consumers

# websocket_urlpatterns = [
#     re_path(r'comm/logger/send/(?P<id>\w+)/$',
#             consumers.LoggerSendConsumer.as_asgi()),
#     re_path(r'comm/logger/receive/(?P<id>\w+)/$',
#             consumers.LoggerReceiveConsumer.as_asgi()),
#     re_path(r'comm/device/change/',
#             consumers.DeviceChangeConsumer.as_asgi()),
#     re_path(r'comm/command/(?P<id>\w+)/$',
#             consumers.CommandConsumer.as_asgi()),
#     re_path(r'comm/install/(?P<id>\w+)/$',
#             consumers.InstallConsumer.as_asgi()),
# ]
websocket_urlpatterns = URLRouter([url(r'comm/logger/send/(?P<id>\w+)/$',
                                       consumers.LoggerSendConsumer.as_asgi()),
                                   url(r'comm/logger/receive/(?P<id>\w+)/$',
                                       consumers.LoggerReceiveConsumer.as_asgi()),
                                   url(r'comm/device/change/',
                                       consumers.DeviceChangeConsumer.as_asgi()),
                                   url(r'comm/command/(?P<id>\w+)/$',
                                       consumers.CommandConsumer.as_asgi()),
                                   url(r'comm/install/(?P<id>\w+)/$',
                                       consumers.InstallConsumer.as_asgi()), ]
                                  )
